package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacRule;
import com.ysd.lis.service.bac.BacRuleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wanghuaixing
 * @since 2024-04-12
 */
@RestController
@RequestMapping("/bac/rule")
public class BacRuleController extends BaseController {

    @Autowired
    BacRuleService bacRuleService;

    @ApiOperation("查询")
    @GetMapping("/findBacRuleList")
    public Result findBacRuleList(BacRule bacRule) {
        return bacRuleService.findBacRuleList(bacRule);
    }

    @ApiOperation("查询")
    @GetMapping("/findBacRuleConditionOperatList")
    public Result findBacRuleConditionOperatList(String code) {
        return bacRuleService.findBacRuleConditionOperatList(code);
    }

    @ApiOperation("增加")
    @PostMapping("/addBacRule")
    public Result addBacRule(@RequestBody BacRule bacRule) {
        return bacRuleService.addBacRule(bacRule);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteBacRule")
    public Result deleteBacRule(@RequestBody List<String> codes) {
        return bacRuleService.deleteBacRule(codes);
    }

    @ApiOperation("修改")
    @PostMapping("/updateBacRule")
    public Result updateBacRule(@RequestBody BacRule bacRule) {
        return bacRuleService.updateBacRule(bacRule);
    }

    @ApiOperation("查询规则明细")
    @GetMapping("/findBacRuleDetialList")
    public Result findBacRuleDetialList(BacRule bacRule) {
        return bacRuleService.findBacRuleDetialList(bacRule);
    }

    @ApiOperation("添加所有条件")
    @PostMapping("/addAllBacRule")
    public Result addAllBacRule(@RequestBody BacRule bacRule) {
        return bacRuleService.saveAllRule(bacRule);
    }

//    @ApiOperation("批量删除")
//    @PostMapping("/batchDeleteBacDescOption")
//    public Result batchDeleteBacDescOption(@RequestBody List<BacCulProResult> bacCulProResultList) {
//        return bacCulProResultService.batchDeleteBacDescOption(bacCulProResultList);
//    }

}
